import request from "@/request/api";

export function login(username, password) {
  return request({
    url: "/eam-service-system/system/staff/outStafflogin",
    method: "post",
    data: {
      username,
      password,
    },
  });
}
//外单位登录接口
export function outStaffLogin(data) {
  return request({
    url: "/eam-service-system/system/staff/outStaffloginByMobile",
    method: "post",
    data: data,
  });
}
//外单位手机登录
export function outStaffLoginByPhone(data) {
  return request({
    url: "/eam-service-system/system/staff/outStaffloginByPhone",
    method: "post",
    data: data,
  });
}
//外单位重置密码
export function resetPassword(data) {
  return request({
    url: "/eam-service-system/system/staff/forgetPw",
    method: "post",
    data: data,
  });
}

//通过账号查询用户的权限及基本信息
export function queryStaffInfo(data) {
  return request({
    url: "/eam-service-system/system/staff/queryStaffInfo",
    method: "get",
    params: data,
  });
}

//获取验证码
export function getVerifyCode(data) {
  return request({
    url: "/eam-service-system/system/staff/verifyCode",
    method: "get",
    params: data,
  });
}

//获取手机登录验证码
export function getPhoneLoginCode(data) {
  return request({
    url: "/eam-service-system/system/staff/sendPhoneLoginMessage",
    method: "get",
    params: data,
  });
}

//获取忘记密码验证码
export function getPhoneCode(data) {
  return request({
    url: "/eam-service-system/system/staff/sendPhoneMessage",
    method: "get",
    params: data,
  });
}

//获取公钥
export function getPublicKey(data) {
  return request({
    url: "/eam-service-system/system/staff/getPublicKey",
    method: "get",
    params: data,
  });
}

//统一用户查询用户的权限及基本信息
export function getSsoLoginUserInfo(data) {
  return request({
    url: "/eam-service-auth/auth/getSsoLoginUserInfo.htm",
    method: "get",
    params: data,
  });
}
//OA用户查询用户的权限及基本信息
export function getOaLoginUserInfo(data) {
  return request({
    url: "/eam-service-auth/auth/getOaLoginUserInfo.htm",
    method: "get",
    params: data,
  });
}

//用户查询用户的权限及基本信息
export function getCurrUserInfo(data) {
  return request({
    url: "/eam-service-system/system/staff/getCurrUserInfo",
    method: "get",
    params: data,
    // headers: {
    //   noToken:false
    // }
  });
}
